<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="renderer" content="webkit">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<title>广告推广 - 管理中心</title>
{include file="head"}
<link href="/static/thinkct/css/basic.css?v=1" rel="stylesheet" type="text/css" /><script language="javascript" src="/static/thinkct/js/jquery.m.js"></script><script language="javascript" src="/static/thinkct/js/layui/layui.js"></script><script language="javascript" src="/static/thinkct/js/common.js?v=1"></script><script language="javascript" src="/static/thinkct/js/member.js?v=1"></script><link href="/static/thinkct/css/member.css?v=1" rel="stylesheet" type="text/css" /><link href="/static/thinkct/js/layui/css/layui.css" rel="stylesheet" type="text/css" /></head>
<body>
<!--头部-->
{include file="uhead"}

<!--头部-->
<div class="umain">
{include file="uleft"}
 <div class="uright">
<div class="mwz">
<li class="cur"><a>广告推广</a></li>
<li><a href='/member/lists/promotion/'>推广记录</a></li>
<li class="prompt r"><a href="/help/view/3" target=_blank>怎么获得积分?</a></li>
</div>

<div class="promotion layui-form">
<ul class="u1">
<li class="l1" style="width:100%;padding:0">
<font color="#237fbd" style="overflow: hidden;
text-overflow:ellipsis;
white-space: nowrap;padding:0 7px;display: block;"id='shoptit'>【商家】{$data.name}</font> </li>
</li> 
</ul>
{foreach $list as $v}
<ul class="u2" id="div0">
	<li class="l1"><strong>{$v.tit}</strong></li>
	<li class="l2">
	{if 1==2}<font color="#b23a3a"><strong>系统提示：</strong>此广告已满，当前有<font color="#237fbd">[1人]</font>正在排队中；可先购买进入排队，排队期间不计时，有空位自动展示。</font>{/if}
	{if 1==1}<font color="#b23a3a"><strong>系统提示：</strong>{$v.sm}</font>{/if}
	</li>
</ul>
<ul class="u3" id="div1">
{foreach $v.data as $k}
<li class="l1"><input type="radio" name="ads"  value="{$k.id}" lay-filter='ads' jifen='{$k.jifen}' money='{$k.money}' title='购买{$k.day}天&nbsp;&nbsp;&nbsp;&nbsp;价格<span class="jifen">{$k.jifen}</span>积分或<span class="money">{$k.money}</span>元' /></li> 
{/foreach}
<div class='setup_div'>
</div>
</ul>
{/foreach}
<ul class="u4" id="buypay" style="display:none">
<li class="l1">
<div class="s1"><strong>支付方式：</strong><input type="radio" lay-filter='paytype' name="paytype" value="jifen"  title='积分支付'/>
<input type="radio" lay-filter='paytype' name="paytype" value="money" checked title='余额支付'/></div>
<div class="s2"><span id="pay_tips"></span></div>
</li>

<li class="l2">您的账户尚有<span class="jifen">{$user.jifen}</span>积分，余额<span class="money" >{$user.money}</span>元</li>
<li class="l2">请输入您的安全码：<input name="safe" class="layui-input" value="" lay-verify="prosafe" type="password" placeholder="请输入安全码" style="width:200px;border:#56aa16 solid 1px;"></li>
<li class="l3"> <strong id="zj_tips"></strong> </li>
</ul>

<ul class="u5">
	<input type="button" class="layui-btn layui-btn-danger" lay-submit="" name="" lay-filter="promotion"  value='确认购买'> 
	<a href="javascript:void(0)" class='preview'>选择其他商品</a>
</ul>
 <input type="hidden" name="mid" value="{$mid}">
 <input type="hidden" name="good" value="sell">
 <input type="hidden" name="action" value="promotion">
</form>
<div class="notes" style='margin-top:0;'>
<li> <h3>注意事项及说明：</h3></li>
<li><b>1.</b>推广广告购买成功后，可转移至其他商品，但不接受任何理由的退款请求；</li>
<li><b>2.</b>因商品自身违规被禁（可转移）或店铺被封禁，商家需自行承担后果，不接受退款请求。</li>
<li><b>3.</b>推广广告购买成功后，可以使用积分兑换<a style="text-decoration: underline;" href="/jifen/10" target="_blank">广告插队卡</a>来提升广告排队位置。</li>

 </div>
</div>
 </div>
{include file="bottom"}<script>
layui.use('form',function(){var form=layui.form();form.verify({prosafe:function(value){if(!/(?=^.*?\d)(?=^.*?[a-zA-Z])^[0-9a-zA-Z_~!@#$%^&^&$]{6,20}$/.test(value))return"安全码不少于6位，且同时包含数字+字母";var message='';$.ajax({async:false,url:'/aform/index/safe',data:{str:value},dataType:'json',type:'POST',success:function(result){if(!result.state)message=result.info},error:function(){message='网络异常，请重试！'}});if(message!=='')return message;　}});var mymoney={$user.money};var myjifen={$user.jifen};var title=$('#shoptit').html();$(".layui-btn").attr("disabled",true);form.on('radio(ads)',function(data){var money=$(data.elem).attr('money');var jifen=$(data.elem).attr('jifen');$('#buypay').show();$('#pay_tips').html("此次推广需支付费用: <span class=jifen>"+jifen+"</span> 积分 或 <span class=money>"+money+"</span> 元");ifpay(0)});form.on('radio(paytype)',function(data){ifpay(data.value)});form.on('submit(promotion)',function(data){layer.confirm("确定支付<b class=orange> "+$('#zj_tips span').html()+" </b> "+($(":radio[name=paytype]:checked").val()=='money'?'':'积分')+"购买本次推广吗？",{icon:3},function(index){layer.load();Aform('promotion',data.field);layer.close(index)});return false});function ifjifen(){var jifen=$(":radio[name=ads]:checked").attr('jifen');var tips="<font color=blue>积分不足,可选择使用余额支付</font>";var ifbtn=true;if(myjifen>=jifen){tips="使用<span class=red>"+jifen+"</span>积分支付本次推广商品"+title+"的费用。";ifbtn=false}$('#zj_tips').html(tips);$(".layui-btn").attr("disabled",ifbtn);return ifbtn}function ifmoney(){var money=$(":radio[name=ads]:checked").attr('money');var tips='<font color=blue>余额不足,请先<form id="op" method="post" action="/onpay/'+money+'" target="_blank" style="display:inline-block"><input type="hidden" value="5f1e6990f6302a27cc1cf28e94fba16532ecf27b817acc086388ae1b4fe9480b9a02d2e773a56aaa371dabd64bac7c6e7e49495c9a4781b3952c6c1f8984b11dEO4Q/aNASYsjeLPlExwk2XaBuPij7E3CLHNbdbCNj5tmYUd9XQyx1/uU20pZTV7Q" name="passkey" /><a style="color:#ff6600;text-decoration:underline" onclick="$(\'#op\').submit();">充值</a></form>。</font>';var ifbtn=true;if(mymoney>=money){tips="使用<span class=red>￥"+money+"</span>支付本次推广商品"+title+"的费用。";ifbtn=false}$('#zj_tips').html(tips);$(".layui-btn").attr("disabled",ifbtn);return ifbtn}function ifpay(type){if(type==0){if(!ifjifen()){$(":radio[name=paytype][value='jifen']").attr('checked',true)}else if(!ifmoney()){$(":radio[name=paytype][value='money']").attr('checked',true)}form.render('radio');return false}eval("if"+type+"();")}})
</script>
</body>
</html>